home *** CD-ROM | disk | FTP | other *** search
- unit ExeU;
-
- interface
-
- uses
- SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
- Forms, Dialogs, StdCtrls, Spin;
-
- type
- TForm1 = class(TForm)
- Label1: TLabel;
- S1: TSpinEdit;
- S2: TSpinEdit;
- procedure ValueChange(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- uses
- ImportU;
-
- {$R *.DFM}
-
- procedure TForm1.ValueChange(Sender: TObject);
- begin
- if (S1.Text = '') or (S2.Text = '') then
- Label1.Caption := 'N/A'
- else if S1.Value < 0 then
- Label1.Caption := 'Powers of negative numbers not supported'
- else
- Label1.Caption := FloatToStr(Power(S1.Value, S2.Value));
- end;
-
- end.
-